﻿@using WHLRDF.Model
@model TemplateEntity
@inject IDictionaryService iDService
@{

    ViewData["Title"] = "模板管理 编辑";
    Layout = "../Shared/_Layout.cshtml";
    string DictionaryParentId = "0001";

}
@section links{


}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content text-center p-md">
                    <form id="dynamic-form" asp-action="Edit" method="post" class="form-horizontal" role="form">
                        <div asp-validation-summary="@ValidationSummary.All" class="text-danger"></div>
                        <input type="hidden" asp-for="TemplateId" />
                        <div class="form-group">
                            <label asp-for="TemplateType" class="col-md-3 control-label text-right"> 类别</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b text-left">
                                    <span class="input-group-addon"></span>
                                    <select asp-for="TemplateType" tabindex="1" class="select2" validate="{required:true}">
                                        <option value="">请选择</option>
                                        @{
                                            var lstDservice = iDService.GetDicByParentId(DictionaryParentId);
                                            if (lstDservice != null && lstDservice.Count > 0)
                                            {
                                                foreach (var item in lstDservice)
                                                {
                                                    <option value="@item.KeyValue">@item.KeyName</option>
                                                }
                                            }
                                        }
                                    </select>
                                </div>
                                <span asp-validation-for="TemplateType" class="text-danger"></span>
                            </div>

                        </div>
                        <div class="form-group">
                            <label asp-for="Title" class="col-md-3 control-label text-right"> 标题</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon">*</span>
                                    <input asp-for="Title" class="form-control" validate="{required:true  ,maxlength:100   }" />
                                </div>
                                <span asp-validation-for="Title" class="text-danger"></span>
                            </div>

                        </div>
                        <div class="form-group">
                            <label asp-for="Remark" class="col-md-3 control-label text-right">描述</label>
                            <div class="col-md-9  text-left">
                                <div class="input-group m-b">
                                    <span class="input-group-addon"></span>
                                    <input asp-for="Remark" class="form-control" validate="{required:false  ,maxlength:200   }" />
                                </div>
                                <span asp-validation-for="Remark" class="text-danger"></span>
                            </div>

                        </div>
                        <div class="form-group">
                            <label asp-for="Content" class="col-md-3 control-label text-right"> 内容</label>
                            <div class="col-md-9 text-left">
                                <textarea asp-for="Content" tabindex="4" data-typeno="AT0002" class="summernote" style="width:100%;height:200px;"></textarea>
                            </div>

                        </div>

                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <a class="btn btn-white" asp-action="index" >返  回</a>

                                <button class="btn btn-primary" type="submit">保存</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section scripts{
   
    <script type="text/javascript">
    $(function () {
        $(document).ready(function () {
            $(".form-horizontal").CustomForm({
                isValidate: true,
                isTable: false
            });
            
	  });
    });
    </script>
}